›;**********************************›;›; PROGRAM TO CHECK OUT UPLOAD OF›; CUSTOM FORMATS TO THE DUPLICATOR›;›;**********************************›;›PROC Siov=$E459()[]››BYTE FUNC hi=*(CARD a)›;›;returns the high order byte of a›;›[$86$A0] ;stx $A0 high order byte›[$60] ;retrun››BYTE FUNC lo=*(CARD a)›;›;returns lo byte of a›;›[$85$A0] ;sta $A0 low order byte›[$60] ;return›;›PROC pbyt(BYTE a)›;›;print hex of byte a›;›BYTE temp››temp=a & $F0›temp=temp RSH 4 ;get low nibble›IF temp <$0A THEN› temp=temp+'0›ELSE › temp=temp+7+'0›FI›PutD(2,temp) ;print upper nibble›temp=a & $0F›IF temp <$0A THEN› temp=temp+'0›ELSE › temp=temp+7+'0›FI›PutD(2,temp)›RETURN››PROC pdat(BYTE a)››pbyt(a)›PutD(2,' ) ;print space› ›RETURN››PROC padr(CARD a)›;›;print hex value of a›;›BYTE b››b=hi(a)›pbyt(b)›b=lo(a)›pbyt(b)›PutD(2,' ) ;print space›RETURN››PROC pasc(BYTE ARRAY a)›;›;print out ascii of hex data›;›BYTE index,dat››index=0›DO› dat=a(index)› IF dat<$20 OR dat > $7A THEN› dat='.› FI› PutD(2,dat)› index==+1› UNTIL index=16›OD›PutDE(2)›RETURN››BYTE FUNC m_stat(BYTE cmd)››BYTE ARRAY rd_cmd="RSat",› wd_cmd="Wmuvwnc"›BYTE i,len,a››i = 1›len = rd_cmd(0)›DO› a=rd_cmd(i)› IF a = cmd THEN› RETURN(64)› FI› i ==+1› UNTIL i=len+1›OD›i=1›len=wd_cmd(0)›DO› a=wd_cmd(i)› IF a=cmd THEN› RETURN(128)› FI› i==+1› UNTIL i=len+1›OD›RETURN(0)››BYTE FUNC sio(BYTE dev,drv,cmd CARD buf,cnt,sec)››BYTE ARRAY dcb=$300 ›CARD ARRAY dcbc=$300›BYTE stat=$303››dcb(0)=dev›dcb(1)=drv›dcb(2)=cmd›stat = m_stat(cmd)›dcbc(2)=buf›dcbc(4)=cnt›dcbc(5)=sec›Siov()›RETURN(stat)››BYTE FUNC set_adr(BYTE drv CARD adr)››BYTE r›CARD na››na=0›r=sio($31,drv,'s,na,na,adr)››RETURN(r)››BYTE FUNC seek(BYTE drv,track)››BYTE r›CARD na›r=sio($31,drv,'g,na,na,track)›RETURN(r)››BYTE FUNC cust(BYTE drv BYTE POINTER t CARD i)››BYTE r,time=$306 ›CARD len ›BYTE temp››len = 1›time=$E0›r=sio($31,drv,'c,t,len,i)›time=$0F›RETURN(r)›››BYTE FUNC run(BYTE drv CARD adr)››BYTE r›CARD na››na=0›r=sio($31,drv,'r,na,na,adr)››RETURN(r)››BYTE FUNC up_load(BYTE drv BYTE ARRAY buff)››BYTE r››r=sio($31,drv,'u,buff,$100,0)››RETURN(r)››CARD FUNC gen_blk(BYTE d CARD a,i,c)››BYTE ARRAY f›CARD cnt››f=a ›cnt=0 ›DO› f(i)=d› i==+1› cnt==+1› UNTIL cnt=c›OD›RETURN(i) ››CARD FUNC gen_sec(BYTE ARRAY a CARD i BYTE s,t) ››BYTE ARRAY skew=[1 3 5 7 9 11 13 15 17 2 4 6 8 10 12 14 16 18]›BYTE ARRAY skew1=[17 15 13 11 9 7 5 3 1 17 16 14 12 10 8 6 4 2]›CARD cnt››cnt=10 ›i = gen_blk(255,a,i,cnt)›cnt=4›i=gen_blk(0,a,i,cnt)›a(i)=$FE›i==+1›a(i)=t ;track number›i==+1›a(i)=0 ;side number›i==+1›a(i)=skew(s) ;sector number›i==+1›a(i)=128 ;sector lenth›i==+1›a(i)=$F7›i==+1›cnt=11›i=gen_blk(255,a,i,cnt)›cnt=6›i=gen_blk(0,a,i,cnt)›a(i)=$FB›i==+1›cnt=128›i=gen_blk(255,a,i,cnt)›a(i)=$F7›i==+1›RETURN(i)››CARD FUNC gen_fmt(BYTE track BYTE ARRAY a)››CARD i›BYTE sec,n››i=0›IF track = 39 THEN› n = 17›ELSE› n = 18›FI›sec=0›DO› i=gen_sec(a,i,sec,track)› sec==+1› UNTIL sec=n ;eighteen sectors›OD›RETURN(i)››PROC zero(BYTE ARRAY b)››CARD i››i=0›DO› b(i)=0› i==+1› UNTIL i=5000›OD›RETURN››PROC main()››BYTE ARRAY buff(5000)›BYTE drive,res,track,time›CARD data,c,i,cnt››Print("drive number format:")›drive=InputB()›Print("formating drive:")›PrintBE(drive)›track=0›zero(buff)›DO› set_adr(drive,8192)› PrintE("Gen format")› i = gen_fmt(track,buff)› Print("Number of bytes in buff=")› PrintCE(i)› data=buff› c=0› DO› res=up_load(drive,data)› data=data+256 ;next block of data› c==+256› UNTIL c > i› OD› Print("Seeking track:")› PrintCE(track)› res = seek(drive,track)› Print("Formating track:")› PrintCE(track)› time = 203› res = cust(drive,@time,i)› track==+1› UNTIL track=40›OD›RETURN››99999999999999999999999999999999999999999999999999999999999999999999999